package com.test2;

import com.service.StuServie;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

public class Test1 {
    static StuServie stuServie;
    public static void main(String[] args) {
   /*     StringBuilder builder = new StringBuilder();
        builder.append("1");
        builder.setLength(0);
        System.out.println(builder);*/
        System.out.println(BigDecimal.ZERO);
        List<Student1> list = new ArrayList<>();
        Student1  s1= new Student1("1",22);
        Student1  s2= new Student1("2",0);
        Student1  s3= new Student1("3",0);
        Student1  s4= new Student1("4",66);

        list.add(s1);list.add(s2);list.add(s3);list.add(s4);
        System.out.println(list.size());
        list= list.stream().filter(o -> ("0").equals(o.getAge())).collect(Collectors.toList());

        List<Integer> strList = list.stream().map(student1 -> student1.getAge()).collect(Collectors.toList());
        List<Student1> list1 = list.stream().sorted(Comparator.comparing(Student1::getAge)).collect(Collectors.toList());
        System.out.println("map的作用"+strList);
        System.out.println("sorted的作用"+list1);
        list.forEach(l->{
            l.setAge(2);
        });
        System.out.println(list.size());
    //    list.stream().forEach(stuServie::insert);

    }
}
